package com.chixing.day08_interface.homework;

public class dealOrder {
    private order order1;

    public dealOrder(order order)
    {
        this.order1=order;
    }
    public  order deal()
    {


        order halforder=null;
        if(order1.getNumber()<1000)
            halforder=this.order1.clone();
        else
        {
            while(order1.getNumber()>=1000)
            {

                halforder=this.order1.clone();
                halforder.setNumber(this.order1.getNumber()/2);
                this.order1=halforder.clone();

            }
        }
        return halforder;

    }
}
